package lean;
import java.util.Arrays;
public class two {
    public static void main(String[] args) {
        int num1[][] = {{99, 88, 77, 55, 33}, {45, 44, 33, 22, 11}, {88, 99, 100, 11, 12}, {11, 22, 44, 66, 77, 99}, {100, 99, 98, 66, 33}};
        for (int i = 0; i < num1.length; i++) {
            System.out.print("第" + (i + 1) + "个班级成绩:");
            System.out.println(Arrays.toString(num1[i]));
        }
        //成绩从高到低排序
        for(int i=0;i<num1.length;i++){
            for(int j=0;j<num1[i].length-1;j++){
                int count=0;
                for(int k=0;k<num1[i].length-i;k++){
                    if(num1[j][k]<num1[j][(k++)]){
                        count=num1[j][k+i];
                        num1[j][(k+j)]=num1[j][k];
                        num1[j][k]=count;
                    }
                }
                //System.out.println("第"+(i+1)+"个班级的成绩从高到低:"+Arrays.toString(num1[i]));
            }
            System.out.println("第"+(i+1)+"个班级的成绩从高到低:"+Arrays.toString(num1[i]));
        }
    }
}
